package consistencia;


import java.awt.event.KeyEvent;
import javax.swing.JTextField;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Ramayane
 */
public class ValidaCampoNumerico extends JTextField {

    @Override
    protected void processKeyEvent(KeyEvent e) {


        if (e.getID() == KeyEvent.KEY_TYPED) {

            if ("0123456789".indexOf(e.getKeyChar()) == -1) {
                e.consume();
                return;

            }
        }
        super.processKeyEvent(e);
    }
}
